{"componentChunkName":"component---node-modules-rocketseat-gatsby-theme-docs-core-src-templates-docs-query-js","path":"/manual-review/TesseractVaultDeployer-TVD","result":{"data":{"mdx":{"id":"0b95bcc6-c254-5e76-9661-87567cb3e635","excerpt":"TVD-01M: Inexistent Control Variable of Fees Type Severity Location Logical Fault TesseractVaultDeployer.sol:L206 ,  L221-L227 ,  L276-L277 Description: The…","fields":{"slug":"/manual-review/TesseractVaultDeployer-TVD/"},"frontmatter":{"title":"TesseractVaultDeployer Manual Review Findings","description":"Contains all the findings that relate to manual review on the contract codebase","image":null,"disableTableOfContents":null},"body":"var _excluded = [\"components\"];\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\n/* @jsxRuntime classic */\n\n/* @jsx mdx */\nvar _frontmatter = {\n  \"title\": \"TesseractVaultDeployer Manual Review Findings\",\n  \"description\": \"Contains all the findings that relate to manual review on the contract codebase\"\n};\nvar layoutProps = {\n  _frontmatter: _frontmatter\n};\nvar MDXLayout = \"wrapper\";\nreturn function MDXContent(_ref) {\n  var components = _ref.components,\n      props = _objectWithoutProperties(_ref, _excluded);\n\n  return mdx(MDXLayout, _extends({}, layoutProps, props, {\n    components: components,\n    mdxType: \"MDXLayout\"\n  }), mdx(\"h2\", {\n    \"id\": \"span-idtvd-01mtvd-01m-inexistent-control-variable-of-feesspan\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, mdx(\"a\", {\n    parentName: \"h2\",\n    \"href\": \"#span-idtvd-01mtvd-01m-inexistent-control-variable-of-feesspan\",\n    \"aria-label\": \"span idtvd 01mtvd 01m inexistent control variable of feesspan permalink\",\n    \"className\": \"anchor before\"\n  }, mdx(\"svg\", {\n    parentName: \"a\",\n    \"aria-hidden\": \"true\",\n    \"focusable\": \"false\",\n    \"height\": \"16\",\n    \"version\": \"1.1\",\n    \"viewBox\": \"0 0 16 16\",\n    \"width\": \"16\"\n  }, mdx(\"path\", {\n    parentName: \"svg\",\n    \"fillRule\": \"evenodd\",\n    \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n  }))), mdx(\"span\", {\n    id: \"TVD-01M\"\n  }, \"TVD-01M: Inexistent Control Variable of Fees\")), mdx(\"table\", null, mdx(\"thead\", {\n    parentName: \"table\"\n  }, mdx(\"tr\", {\n    parentName: \"thead\"\n  }, mdx(\"th\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"Type\"), mdx(\"th\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"Severity\"), mdx(\"th\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"Location\"))), mdx(\"tbody\", {\n    parentName: \"table\"\n  }, mdx(\"tr\", {\n    parentName: \"tbody\"\n  }, mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, mdx(\"a\", {\n    parentName: \"td\",\n    \"href\": \"/reports/tesseract-earn-vault-69b81216873cc00015ff3fbf/appendix/finding-types#logical-fault\"\n  }, \"Logical Fault\")), mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, mdx(\"img\", {\n    parentName: \"td\",\n    \"className\": \"o-severity o-minor\",\n    \"src\": \"https://omniscia.io/report-assets/minor.png\"\n  })), mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, mdx(\"a\", {\n    parentName: \"td\",\n    \"href\": \"https://github.com/tesseract-crypto/earn-vault-contracts/blob/56ad1199175341183a2c932d66c832c568374269/contracts/TesseractVaultDeployer.sol#L206\"\n  }, \"TesseractVaultDeployer.sol:L206\"), \", \", mdx(\"a\", {\n    parentName: \"td\",\n    \"href\": \"https://github.com/tesseract-crypto/earn-vault-contracts/blob/56ad1199175341183a2c932d66c832c568374269/contracts/TesseractVaultDeployer.sol#L221-L227\"\n  }, \"L221-L227\"), \", \", mdx(\"a\", {\n    parentName: \"td\",\n    \"href\": \"https://github.com/tesseract-crypto/earn-vault-contracts/blob/56ad1199175341183a2c932d66c832c568374269/contracts/TesseractVaultDeployer.sol#L276-L277\"\n  }, \"L276-L277\"))))), mdx(\"h3\", {\n    \"id\": \"description\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#description\",\n    \"aria-label\": \"description permalink\",\n    \"className\": \"anchor before\"\n  }, mdx(\"svg\", {\n    parentName: \"a\",\n    \"aria-hidden\": \"true\",\n    \"focusable\": \"false\",\n    \"height\": \"16\",\n    \"version\": \"1.1\",\n    \"viewBox\": \"0 0 16 16\",\n    \"width\": \"16\"\n  }, mdx(\"path\", {\n    parentName: \"svg\",\n    \"fillRule\": \"evenodd\",\n    \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n  }))), \"Description:\"), mdx(\"p\", null, \"The deployment of a vault via the \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"TesseractVaultDeployer\"), \" may involve performance and management fees to be imposed on it. These fees are configured by the owner of the \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"TesseractVaultDeployer\"), \", meaning that they may change between a vault deployment transaction's submission to the network and its execution.\"), mdx(\"h3\", {\n    \"id\": \"impact\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#impact\",\n    \"aria-label\": \"impact permalink\",\n    \"className\": \"anchor before\"\n  }, mdx(\"svg\", {\n    parentName: \"a\",\n    \"aria-hidden\": \"true\",\n    \"focusable\": \"false\",\n    \"height\": \"16\",\n    \"version\": \"1.1\",\n    \"viewBox\": \"0 0 16 16\",\n    \"width\": \"16\"\n  }, mdx(\"path\", {\n    parentName: \"svg\",\n    \"fillRule\": \"evenodd\",\n    \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n  }))), \"Impact:\"), mdx(\"p\", null, \"A user may deploy a vault with a significant \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"initialDeposit\"), \" believing the management / performance fee to be low only for it to be changed before their transaction's execution and increased unfairly.\"), mdx(\"h3\", {\n    \"id\": \"example\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#example\",\n    \"aria-label\": \"example permalink\",\n    \"className\": \"anchor before\"\n  }, mdx(\"svg\", {\n    parentName: \"a\",\n    \"aria-hidden\": \"true\",\n    \"focusable\": \"false\",\n    \"height\": \"16\",\n    \"version\": \"1.1\",\n    \"viewBox\": \"0 0 16 16\",\n    \"width\": \"16\"\n  }, mdx(\"path\", {\n    parentName: \"svg\",\n    \"fillRule\": \"evenodd\",\n    \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n  }))), \"Example:\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-sol\",\n    \"metastring\": \"title=contracts/TesseractVaultDeployer.sol highlight={40,41} lineNumbers=true lineOffset=236\",\n    \"title\": \"contracts/TesseractVaultDeployer.sol\",\n    \"highlight\": \"{40,41}\",\n    \"lineNumbers\": \"true\",\n    \"lineOffset\": \"236\"\n  }, \"function _deployVault(uint256 initialDeposit)\\n    internal\\n    returns (FusionFactoryLogicLib.FusionInstance memory fusionInstance)\\n{\\n    if (initialDeposit < minInitialDeposit) revert InsufficientInitialDeposit();\\n\\n    // Step 1: Clone vault with deployer as temporary owner\\n    fusionInstance = FUSION_FACTORY.clone(\\n        assetName,\\n        assetSymbol,\\n        UNDERLYING_TOKEN,\\n        REDEMPTION_DELAY_IN_SECONDS,\\n        address(this),\\n        daoFeePackageIndex\\n    );\\n\\n    IporFusionAccessManager accessManager = IporFusionAccessManager(fusionInstance.accessManager);\\n\\n    // Step 2: Grant OWNER-managed roles\\n    accessManager.grantRole(Roles.GUARDIAN_ROLE, guardian, 0);\\n\\n    // Step 3: Grant temporary ATOMIST_ROLE to deployer\\n    accessManager.grantRole(Roles.ATOMIST_ROLE, address(this), 0);\\n\\n    // Step 4: Grant ATOMIST-managed roles\\n    accessManager.grantRole(Roles.ALPHA_ROLE, alpha, 0);\\n    accessManager.grantRole(Roles.WHITELIST_ROLE, msg.sender, 0);\\n    accessManager.grantRole(Roles.WHITELIST_ROLE, address(this), 0);\\n    accessManager.grantRole(Roles.FUSE_MANAGER_ROLE, atomist, 0);\\n    accessManager.grantRole(Roles.FUSE_MANAGER_ROLE, fuseManager, 0);\\n    accessManager.grantRole(Roles.CONFIG_INSTANT_WITHDRAWAL_FUSES_ROLE, alpha, 0);\\n    accessManager.grantRole(Roles.CLAIM_REWARDS_ROLE, tesseractRewardsManager, 0);\\n    accessManager.grantRole(Roles.TRANSFER_REWARDS_ROLE, tesseractRewardsManager, 0);\\n    accessManager.grantRole(Roles.UPDATE_REWARDS_BALANCE_ROLE, tesseractRewardsManager, 0);\\n\\n    // Step 5: Grant real ATOMIST_ROLE\\n    accessManager.grantRole(Roles.ATOMIST_ROLE, atomist, 0);\\n\\n    // Step 6: Configure fees (skip if both are 0)\\n    uint256 perfFee = performanceFee;\\n    uint256 mgmtFee = managementFee;\\n    if (perfFee > 0 || mgmtFee > 0) {\\n\")), mdx(\"h3\", {\n    \"id\": \"recommendation\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#recommendation\",\n    \"aria-label\": \"recommendation permalink\",\n    \"className\": \"anchor before\"\n  }, mdx(\"svg\", {\n    parentName: \"a\",\n    \"aria-hidden\": \"true\",\n    \"focusable\": \"false\",\n    \"height\": \"16\",\n    \"version\": \"1.1\",\n    \"viewBox\": \"0 0 16 16\",\n    \"width\": \"16\"\n  }, mdx(\"path\", {\n    parentName: \"svg\",\n    \"fillRule\": \"evenodd\",\n    \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n  }))), \"Recommendation:\"), mdx(\"p\", null, \"We advise control variables to be introduced for vault deployers, permitting them to specify the maximum management / performance fee they are willing to accept  for the \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"initialDeposit\"), \" they have configured, akin to how slippage functions in AMM trades.\"), mdx(\"h3\", {\n    \"id\": \"alleviation-fdf0694b5c38834fa5a20cb2765766924d34f5d4\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#alleviation-fdf0694b5c38834fa5a20cb2765766924d34f5d4\",\n    \"aria-label\": \"alleviation fdf0694b5c38834fa5a20cb2765766924d34f5d4 permalink\",\n    \"className\": \"anchor before\"\n  }, mdx(\"svg\", {\n    parentName: \"a\",\n    \"aria-hidden\": \"true\",\n    \"focusable\": \"false\",\n    \"height\": \"16\",\n    \"version\": \"1.1\",\n    \"viewBox\": \"0 0 16 16\",\n    \"width\": \"16\"\n  }, mdx(\"path\", {\n    parentName: \"svg\",\n    \"fillRule\": \"evenodd\",\n    \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n  }))), \"Alleviation (fdf0694b5c38834fa5a20cb2765766924d34f5d4):\"), mdx(\"p\", null, \"Proper control variables called \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"maxManagementFee\"), \" and \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"maxPerformanceFee\"), \" have been introduced to the \", mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://github.com/tesseract-crypto/earn-vault-contracts/blob/fdf0694b5c38834fa5a20cb2765766924d34f5d4/contracts/TesseractVaultDeployer.sol#L237-L321\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"a\"\n  }, \"TesseractVaultDeployer::_deployVault\")), \" function and its parent calls that are checked against the current \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"managementFee\"), \" and \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"performanceFee\"), \" respectively, alleviating this exhibit in full.\"), mdx(ViewDiffButton, {\n    repoUrl: \"https://github.com/tesseract-crypto/earn-vault-contracts\",\n    mainHash: \"56ad1199175341183a2c932d66c832c568374269\",\n    fixHash: \"fdf0694b5c38834fa5a20cb2765766924d34f5d4\",\n    gitHubIssue: \"12\",\n    mdxType: \"ViewDiffButton\"\n  }));\n}\n;\nMDXContent.isMDXComponent = true;","headings":[{"depth":2,"value":"<span id=\"TVD-01M\">TVD-01M: Inexistent Control Variable of Fees</span>"},{"depth":3,"value":"Description:"},{"depth":3,"value":"Impact:"},{"depth":3,"value":"Example:"},{"depth":3,"value":"Recommendation:"},{"depth":3,"value":"Alleviation (fdf0694b5c38834fa5a20cb2765766924d34f5d4):"}]}},"pageContext":{"slug":"/manual-review/TesseractVaultDeployer-TVD/","prev":{"label":"ConfigManager.sol (CMR-M)","link":"/manual-review/ConfigManager-CMR"},"next":{"label":"Whitelisting.sol (WGN-M)","link":"/manual-review/Whitelisting-WGN"}}},"staticQueryHashes":["1954253342","2328931024","2501019404","973074209"]}